﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI;

namespace blackhouse.Web.Composite {
	public class CompositeAction<T> where T:Control {

		private T[] controls;

		public CompositeAction(params T[] controls) {
			this.controls = controls;
		}

		public delegate void WebControlAction<T>(T control);

		#region Methods

		public void ExecuteOfAllControls(WebControlAction<T> action) {
			foreach (T control in this.controls) {
				action(control);
			}
		}

		#endregion

	}
}